package jmine.tec.web.front.dispatcher.request;

import jmine.tec.web.front.domain.BackOfficeRequest;
import bancosys.tec.utils.date.Clock;

/**
 * Fills a back office command timestamp
 * 
 * @author lundberg
 * @param <F> form type
 */
public class BackOfficeRequestTimestampFiller<F> implements BackOfficeRequestFiller<F> {

    private Clock clock;

    /**
     * Constructor
     * 
     * @param clock clock
     */
    public BackOfficeRequestTimestampFiller(Clock clock) {
        this.clock = clock;
    }

    /**
     * {@inheritDoc}
     */
    public void fill(BackOfficeRequest request, F form) {
        request.setRequestTimestamp(this.clock.currentTimestamp());
    }
}
